package cn.linran.controller;

import cn.linran.User;
import cn.linran.feignclient.UserFeignClient;
import com.fasterxml.jackson.databind.annotation.JsonAppend;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * Pay服务接口，使用feign调用user接口
 */
@RestController
public class PayController {
    @Autowired
    private UserFeignClient userFeignClient;

    @GetMapping("/getById/{id}")
    public User getById(@PathVariable("id") Long id){
        //调用OpenFeign，通信User服务
        return userFeignClient.getById(id);
    }

}
